<!--  -->
<template>
  <div class="footerList">
    <router-link v-for="(item, idx) in list" :key="idx" :to="item.path">
      <van-icon :name="item.icon" size="20" />
      {{ item.name }}
    </router-link>
  </div>
</template>

<script>
export default {
  // 组件状态值
  data() {
    return {
      list: [
        {
          path: "/homePage",
          name: "首页",
          icon: "wap-home",
        },
        {
          path: "/lookHouse",
          name: "找房",
          icon: "wap-home",
        },
        {
          path: "/publish",
          name: "发布",
          icon: "add",
        },
        {
          path: "/message",
          name: "消息",
          icon: "comment",
        },
        {
          path: "/my",
          name: "我的",
          icon: "manager",
        },
      ],
    };
  },
  // 计算属性
  computed: {},
  // 组件方法
  methods: {},
  /**
   * 组件实例创建完成，属性已绑定，但DOM还未生成，$ el属性还不存在
   */
  created() {},
};
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<!--使用了scoped属性之后，父组件的style样式将不会渗透到子组件中，-->
<!--然而子组件的根节点元素会同时被设置了scoped的父css样式和设置了scoped的子css样式影响，-->
<!--这么设计的目的是父组件可以对子组件根元素进行布局。-->
<style lang="scss" scoped>
.footerList {
  width: 100%;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-around;
  a {
    color: #999;
    display: flex;
    flex-direction: column;
    i {
      text-align: center;
    }
  }
  .router-link-active {
    font-size: 17px;
    color: orangered;
  }
}
</style>
